Improve Garmin error case for Windows USB exclusive error failure to point
authorrobertl <robertl>
Mon, 22 Jan 2007 17:59:41 +0000 (17:59 +0000)
committerrobertl <robertl>
Mon, 22 Jan 2007 17:59:41 +0000 (17:59 +0000)
finger at Spanner and GPSGate-like substances.

jeeps/gpsusbwin.c

index 1fe48959fc6a4bd929c49b8518c229b51fe70858..368ae63e43fa8c325edb6a74111d733286cde8b5 100644 (file)
@@ -161,6 +161,11 @@ HANDLE * garmin_usb_start(HDEVINFO* hdevinfo, SP_DEVICE_INTERFACE_DATA *infodata
        usb_handle = CreateFile(pdd->DevicePath, GENERIC_READ|GENERIC_WRITE, 
                        0, NULL, OPEN_EXISTING, 0, NULL );
        if (usb_handle == INVALID_HANDLE_VALUE) {
+               if (GetLastError() == ACCESS_DENIED) {
+                       warning(
+"Exclusive access is denied.  It's likely that something else such as\n"
+"Nroute, Spanner, Google Earth, or GPSGate already has control of the device\n");
+               }
                GPS_Serial_Error("(usb) CreateFile on '%s' failed", pdd->DevicePath);
                return NULL;
        }